<?php
if (YII_DEBUG) {
	ini_set('error_reporting', E_ALL);
	ini_set('display_errors', 1);
} else {
	ini_set('error_reporting', 0);
	ini_set('display_errors', 1);
};
date_default_timezone_set('Europe/Kiev');
setlocale(LC_ALL, 'ru_RU.UTF-8', 'uk_UK.UTF-8');

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'	 => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
	'name'		 => 'modbet',
	// preloading 'log' component
	'preload'	 => array('log'),
	// autoloading model and component classes
	'import'	 => array(
		'application.models.*',
		'application.components.*',
	),
	'modules'	 => array(
	),
	// application components
	'components' => array(
		'user'			 => array(
			// enable cookie-based authentication
			'allowAutoLogin' => true,
		),
		'session'		 => array(
			'autoStart' => true,
		),
		'db'			 => array(
			'schemaCachingDuration' => 0,
		), // uncomment the following to enable URLs in path-format
		'urlManager'	 => array(
			'urlFormat'		 => 'path',
			'showScriptName' => false,
			'caseSensitive'	 => true,
			'rules'			 => array(
				'admin'														 => 'admin/adminDefault/admin',
				'admin/login'												 => 'admin/adminDefault/login',
				'admin/logout'												 => 'admin/adminDefault/logout',
				'admin/<module:\w+>'										 => '<module>/adminDefault/admin',
				'admin/<module:\w+>/<controler:\w+>'						 => '<module>/admin<controler>/admin',
				'admin/<module:\w+>/<controler:\w+>/<action:\w+>'			 => '<module>/admin<controler>/<action>',
				'admin/<module:\w+>/<controler:\w+>/<action:\w+>/<id:\d+>'	 => '<module>/admin<controler>/<action>',
				//Default
				'<controller:\w+>/<id:\d+>'									 => '<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'					 => '<controller>/<action>',
				'<controller:\w+>/<action:\w+>'								 => '<controller>/<action>',
				'<module:\w+>'												 => '<module>/default/index',
				'<module:\w+>/<controler:\w+>'								 => '<module>/<controler>/index',
				'<module:\w+>/<controler:\w+>/<action:\w+>'					 => '<module>/<controler>/<action>',
				'<module:\w+>/<controler:\w+>/<action:\w+>/<id:\d+>'		 => '<module>/<controler>/<action>',
			),
		),
		'errorHandler'	 => array(
			'errorAction' => 'error/index',
		),
		'errorHandler'	 => array(
			// use 'site/error' action to display errors
			'errorAction' => 'site/error',
		),
		'log'			 => array(
			'class'	 => 'CLogRouter',
			'routes' => array(
				array(
					'class'	 => 'CFileLogRoute',
					'levels' => 'error, warning',
				),
			// uncomment the following to show log messages on web pages
			/*
			  array(
			  'class'=>'CWebLogRoute',
			  ),
			 */
			),
		),
	),
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'	 => array(
		// this is used in contact page
		'adminEmail' => 'webmaster@example.com',
	),
);